		"加载vimrc
			"{
				syntax on
				set tags=./tags
				set history=100
				set nocompatible "与vi不一致
				"set guifont=Courier\New:h12
				filetype off
				set shiftwidth=4 softtabstop=4 expandtab

				set rtp+=~/.vim/bundle/vundle/ "载入特定目录插件
				"set rtp+=$HOME/.vim/bundle/vundle/ "Windows下
				call vundle#rc()
			"}
		"插件加载
			"{
				"增加全文件处理ie或ae命令
				Bundle 'https://github.com/kana/vim-textobj-user'

				"其它需填写用户/资源名称
				Bundle 'gmarik/vundle'

				"代码补全
				Bundle 'snipMate'
				Bundle 'https://github.com/drmingdrmer/xptemplate'

				"非github上资源
				"Bundle 'git://git.wincent.com/command-t.git'
				"Plugin 'git://git.wincent.com/command-t.git'

				"color
				"Bundle 'Lucius'

				"目录浏览
				Bundle 'scrooloose/nerdtree'

				"WinManager
				Bundle 'WinManager'

				"NerdCommenter，注释插件
				Bundle 'scrooloose/NerdCommenter'

				"Vim-airline 状态栏增强插件
				Bundle 'Vim-airline'

				"Ctrlp 文件模糊查找
				Bundle 'https://github.com/kien/ctrlp.vim.git'

				"代码符号
				"Bundle 'majutsushi/tagbar'
				Bundle 'https://github.com/vim-scripts/taglist.vim.git'

				"类似sourceInsight的代码预览窗口
				Bundle 'wesleyche/SrcExpl'

				" 增加尾部空格的显示
				Plugin 'trailing-whitespace'

				" 补全括号或引号等cs,ds,yss
				Plugin 'surround.vim'

				" Markdown格式高亮
			    Plugin 'plasticboy/vim-markdown'

			    " 包含大部分配色
			    Plugin 'flazz/vim-colorschemes'

			    " python语法检测
			    Plugin 'pyflakes.vim'

			    " python自动补全
			    Plugin 'Pydiction'

			    "错误提示
			    Bundle 'https://github.com/scrooloose/syntastic'

			    " c/c++补全
			    Plugin 'OmniCppComplete'
			    Bundle 'Valloric/YouCompleteMe'

			    " js代码格式化
			    Bundle 'maksimr/vim-jsbeautify'

			    "js 错误提示
			    Bundle 'https://github.com/joestelmach/lint.vim'

			    Bundle "pangloss/vim-javascript"
				filetype plugin indent on
			"}
		" Filetype
			autocmd BufRead,BufNewFile *.json set filetype=json
			autocmd BufRead,BufNewFile *.js set filetype=javascript
			autocmd BufRead,BufNewFile *.slim set filetype=slim
		"js代码格式化
			autocmd BufRead,BufNewFile *.html.erb set filetype=eruby.html
			let g:jsbeautify_file = fnameescape(fnamemodify(expand("<sfile>"), ":h")."/bundle/js-beautify/beautify.js")
			map <c-f> :call JsBeautify()<cr>
		"js 函数跳转
			if has("cscope")
			        set csprg=/usr/bin/cscope
			        set csto=0
			        set cst
			        set nocsverb
			        " add any database in current directory
			        if filereadable("cscope.out")
			            cs add ./cscope.out
			        " else add database pointed to by environment
			        elseif $CSCOPE_DB != ""
			            cs add $CSCOPE_DB
			        endif
			        set csverb
			        set cscopetag
			        set cscopequickfix=s-,g-,c-,d-,t-,e-,f-,i-
			endif
		"vim 视图设置
			"{
				set number    "设置行"
				set mouse=a
				set guioptions-=r "gui的右边的滑动条
				set guioptions-=L "gui的左边的滑动条

				"开启光亮光标行{
					set cursorline
					hi CursorLine   cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
				"}
				"开启高亮光标列{
					"set cursorcolumn
					"hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
				"}

				" VIM配色方案
					"colorscheme morning
					colorscheme desert

				 " 从不备份
					set nobackup

				 " 关闭交换文件
					set noswapfile

				" 代码折叠 indent
					set foldmethod=indent
		    		set foldlevel=99

			    " tab切换页面
				    set hidden "in order to switch between buffers with unsaved change
				    map <tab> :bn<cr>
				    map <S-tab> :bp<cr>

			    " 打开文件时自动回到上次编辑的地方
				    if has("autocmd")
				    autocmd BufRead *.txt set tw=78
				    autocmd BufReadPost *
				      \ if line("'\"") > 0 && line ("'\"") <= line("$") |
				      \   exe "normal g'\"" |
				      \ endif
				    endif

			    "vimrc文件修改之后自动加载。 linux。
			    	map <C-A> ggVG"+y
			    	set ruler

			    " <F3> 删除多余空格 {
	       			 map <F3> :%s/\s\+$//<CR>
	   			" }

			    " <F4> 去空行 {
			        "nnoremap <F4> :g/^\s*$/d<CR>
			    " }

			    " <F4> 相对和绝对行号切换 {
			        nnoremap <F4> :call NumberToggle()<cr>
			        function! NumberToggle()
			          if(&relativenumber == 1)
			            set norelativenumber number
			          else
			            set relativenumber
			          endif
			        endfunc
			    " }

			    " <F5> 编译运行 {
			        map <F5> :call CompileRun()<CR>
			        func! CompileRun()
			            exec "w"
			            if &filetype == 'c'
			                exec "!g++ % -o %<"
			                exec "!time ./%<"
			                exec "!rm ./%<"
			            elseif &filetype == 'cpp'
			                exec "!g++ % -o %<"
			                exec "!time ./%<"
			                exec "!rm ./%<"
			            elseif &filetype == 'java'
			                exec "!javac %"
			                exec "!time java %<"
			                exec "!rm ./%<.class"
			            elseif &filetype == 'sh'
			                exec "!time bash %"
			            elseif &filetype == 'python'
			                exec "!time python %"
			            elseif &filetype == 'html'
			                exec "!chrome % &"
			            elseif &filetype == 'go'
			                exec "!go build %<"
			                exec "!time go run %"
			            elseif &filetype == 'md' "MarkDown 解决方案为VIM + Chrome浏览器的MarkDown Preview Plus插件，保存后实时预览
			                exec ":!open -a /Applications/Google\ Chrome.app/ % &"
			            elseif &filetype == 'javascript'
			                exec "!mocha -u tdd %"
			            elseif &filetype == 'coffee'
			                exec "!time coffee %"
			            elseif &filetype == 'ruby'
			                exec "!time ruby %"
			            endif
			        endfunc
			    " }
					set shortmess=atI " 启动的时候不显示那个援助乌干达儿童的提示
					winpos 10 10 " 设定窗口位置
					set lines=60 columns=155 " 设定窗口大小
					set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}

					" 通过使用: commands命令，告诉我们文件的哪一行被改变过
					set report=0
				"自动补全 {
						:inoremap ( ()<ESC>i
						:inoremap ) <c-r>=ClosePair(')')<CR>
						:inoremap { {<CR>}<ESC>O
						:inoremap } <c-r>=ClosePair('}')<CR>
						:inoremap [ []<ESC>i
						:inoremap ] <c-r>=ClosePair(']')<CR>
						:inoremap " ""<ESC>i
						:inoremap ' ''<ESC>i
						function! ClosePair(char)
						if getline('.')[col('.') - 1] == a:char
						return "\<Right>"
						else
						return a:char
						endif
						endfunction
						filetype plugin indent on
						"打开文件类型检测, 加了这句才可以用智能补全
						set completeopt=longest,menu
					"}
				" CTags的设定{
							let Tlist_Sort_Type = "name" " 按照名称排序
							let Tlist_Use_Right_Window = 1 " 在右侧显示窗口
							let Tlist_Compart_Format = 1 " 压缩方式
							let Tlist_Exist_OnlyWindow = 1 " 如果只有一个buffer，kill窗口也kill掉buffer
							let Tlist_File_Fold_Auto_Close = 0 " 不要关闭其他文件的tags
							let Tlist_Enable_Fold_Column = 0 " 不要显示折叠树
							autocmd FileType javascript set tags+=/Users/Tony/xiaoxu/kc-game-svr/tags
							"autocmd FileType h,cpp,cc,c set tags+=/Users/Tony/cpp/tags
							"let Tlist_Show_One_File=1 "不同时显示多个文件的tag，只显示当前文件的
						"设置tags
							set tags=tags
							set autochdir
						"默认打开Taglist
							"let Tlist_Auto_Open=1
					"}

			"}

		"NerdCommenter，注释插件
			"{
				let mapleader=","
			"}

		" syntastic
				"let g:syntastic_check_on_open = 1
				"let g:syntastic_error_symbol = '✗'
				"let g:syntastic_warning_symbol = '⚠'
				"let g:syntastic_auto_loc_list = 1
				"let g:syntastic_loc_list_height = 5
				"let g:syntastic_enable_highlighting = 0
				"let g:syntastic_mode_map = { 'passive_filetypes': ['scss', 'slim'] }

				"nmap <A-up> :lprev<cr>
				"nmap <A-down> :lnext<cr>
				"nmap <A-right> :ll<cr>
		"Ctrlp
			"{
				"set wildignore+=*/tmp/*,*.so,*.o,*.a,*.obj,*.swp,*.zip,*.pyc,*.pyo,*.png,*.gz,*.class,.DS_Store  " MacOSX/Linux
				"let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$'
				"nnoremap <leader>m :CtrlPMRU<CR>
				nnoremap <leader>b :CtrlPBuffer<CR>
				let g:ctrlp_custom_ignore = {
				    \ 'dir':  '\v[\/](node_modules|target|dist)|\.(git|hg|svn|rvm)$',
				    \ 'file': '\v\.(exe|so|dll|zip|tar|tar.gz)$',
				    \ }
				let g:ctrlp_follow_symlinks=1
			"}
		"SET   Winmanager or NERDTree
			"{
				"{
					autocmd VimEnter * NERDTree  "开启vim 自动 运行tree
					let NERDTreeShowBookmarks=1 "显示书签
				"}

				"Add NERDTree and TagList to Winmanager
				let g:NERDTree_title="[NERDTree]"
				function! NERDTree_Start()
				    exec 'NERDTree'
				endfunction
				function! NERDTree_IsValid()
				    return 1
				endfunction
				let g:winManagerWindowLayout='NERDTree|TagList'
				"end

                "map <F1> :NERDTreeToggle<CR>
                "map <F4> :NERDTreeFind<CR>
                let NERDTreeChDirMode=2  "选中root即设置为当前目录
                "let NERDTreeQuitOnOpen=1 "打开文件时关闭树

                "let NERDTreeMinimalUI=1 "不显示帮助面板
                let NERDTreeDirArrows=1 "目录箭头 1 显示箭头  0传统+-|号
                let g:neocomplcache_enable_at_startup = 1
                let g:NERDTreeShowLineNumbers=1

				"使用w-m作为启动winmanager快捷键，以下的配置是为了解决NERDTree的显示问题
				nmap wm :if IsWinManagerVisible() <BAR> WMToggle<CR> <BAR> else <BAR> WMToggle<CR>:q<CR> endif <CR><CR>

				let NERDTreeWinPos='left'
				nnoremap <F2> :NERDTreeToggle<CR>
				let g:Srcexpl_winHeight = 8
				" // Set 100 ms for refreshing the Source Explorer
				let g:SrcExpl_refreshTime = 100
				" // Set "Enter" key to jump into the exact definition context
				let g:SrcExpl_jumpKey = "<ENTER>"
				" // Set "Space" key for back from the definition context
				let g:SrcExpl_gobackKey = "<SPACE>"
				let g:SrcExpl_pluginList = [
				         \ "__Tag_List__",
				                \ "_NERD_tree_"
				                    \ ]
				let g:ctrlp_clear_cache_on_exit = 1
				set tags=tags;/  "搜索上一级建立的tag
			"}

		" <Ctrl> + ww  编辑模式用ctrl+ 默认方向   切换
			"{
				nmap <C-H> <C-W>   "<Ctrl> + w h 进入左边的窗口
				nmap <C-J> <C-W>   "<Ctrl> + w j 进入下边的窗口
				nmap <C-K> <C-W>   "<Ctrl> + w k 进入上边的窗口
				nmap <C-L> <C-W>   "<Ctrl> + w l 进入右边的窗口

				" 插入模式光标移动
				imap <c-k> <Up>
				imap <c-j> <Down>
				imap <c-h> <Left>
				imap <c-l> <Right>
			"}

		" 新建.c,.h,.sh,.java文件，自动插入文件头 {
			        autocmd BufNewFile *.md exec ":call Setmd()"
			        func Setmd()
			            call setline(1,"date: ".strftime("%Y-%m-%d %T"))
			            call append(line("."),"tags: ")
			            call append(line(".")+1,"---")
			            call append(line(".")+2,"")
			        endfunc
			        autocmd BufNewFile *.js,*.cpp,*.[ch],*.sh,*.py,*.html,*.php,*java exec ":call SetTitle()"
			        ""定义函数SetTitle，自动插入文件头
			        func SetTitle()
			            if &filetype=='js'
			                call setline(1, "#-*- encoding: UTF-8 -*-")
			                call append(line("."), "#---------------------------------import------------------------------------")
			                call append(line(".")+1, "#---------------------------------------------------------------------------")
			                call append(line(".")+2, "############################################################################")
			            endif
			            if &filetype=='python'
			                call setline(1, "#-*- encoding: UTF-8 -*-")
			                call append(line("."), "#---------------------------------import------------------------------------")
			                call append(line(".")+1, "#---------------------------------------------------------------------------")
			                call append(line(".")+2, "############################################################################")
			            endif
			            if &filetype=='sh'
			                call setline(1,"\#########################################################################")
			                call append(line("."), "\# File Name: ".expand("%"))
			                call append(line(".")+1, "\# Author: limbo")
			                call append(line(".")+2, "\# mail: 468137306@qq.com")
			                call append(line(".")+3, "\# Created Time: ".strftime("%c"))
			                call append(line(".")+4, "\# Last changed:  TIMESTAMP")
			                call append(line(".")+5, "\#########################################################################")
			                call append(line(".")+6, "\#!/bin/bash".expand("%"))
			                call append(line(".")+7, "")
			            endif
			            if &filetype=='html' || &filetype=='php'
			                call setline(1, "<!--*************************************************************************")
			                call append(line("."), "      > File Name: ".expand("%"))
			                call append(line(".")+1, "      > Author: limbo")
			                call append(line(".")+2, "      > Mail: 468137306@qq.com")
			                call append(line(".")+3, "      > Created Time: ".strftime("%c"))
			                call append(line(".")+4, "      > Last changed:  TIMESTAMP")
			                call append(line(".")+5, " ************************************************************************-->")
			                call append(line(".")+6, "")
			            endif
			            if &filetype=='cpp'
			                call append(line(".")+6, "#include<iostream>")
			                call append(line(".")+7, "using namespace std;")
			                call append(line(".")+8, "")
			            endif
			            if &filetype=='c'
			                call setline(1, "/*************************************************************************")
			                call append(line("."), "      > File Name: ".expand("%"))
			                call append(line(".")+1, "      > Author: limbo")
			                call append(line(".")+2, "      > Mail: 468137306@qq.com")
			                call append(line(".")+3, "      > Created Time: ".strftime("%c"))
			                call append(line(".")+4, "      > Last changed: 2014年12月24日 星期三 11时12分46秒
			                call append(line(".")+5, " ************************************************************************/")
			                call append(line(".")+6, "#include<stdio.h>")
			                call append(line(".")+7, "")
			            endif
			            if &filetype=='php' || &filetype=='html'
			                call setline(9,['<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">','<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">','<head>','    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />','    <title></title>','</head>','<body>','</body>','</html>'])
			            endif
			            if &filetype=='java'
			            call setline(9,['public class '.strpart(expand("%"),0,strlen(expand("%"))-5),'{','}'])
			            endif
			        endfunc
			        autocmd BufNewFile * normal G "新建文件后，自动定位到文件末尾
			    " }